from django.db import models

from mars.utils.models import BaseModel

# 自定义备份数据库ID
AUTOBACKUP_JOB_ID = 'auto_backup_db'

class SchedulerJob(BaseModel):
    """定时任务"""
    job_id= models.CharField(verbose_name="任务唯一标识",max_length=100,unique=True)
    name = models.CharField(verbose_name="任务名称",max_length=30,unique=True)
    # interval = models.CharField(verbose_name="间隔时间",max_length=50,null=True,blank=True)
    status = models.SmallIntegerField(verbose_name="任务状态",default=0,choices=[(0, "未启动"), (1, "已启动"),(2,"暂停")])
    begin_time = models.TimeField(verbose_name="起始时间")
    # frequency = models.CharField(verbose_name="执行频率",max_length=30,unique=True)
    
    class Meta:
        db_table = "tb_scheduler_job"
        verbose_name = "定时任务"
        verbose_name_plural = verbose_name